from celery_tasks.main import celery_app
from users import utils


@celery_app.task(bind=True, name='celery_send_active_email', retry_backoff=3)
def celery_send_active_email(self, email, url):
    """
    发送邮箱激活邮件
    """
    try:
        utils.send_active_email(email, url)
    except Exception as e:
        raise self.retry(exc=e, max_retries=3)
